#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#include<unistd.h>
#define USER "USER"
#define MYVAL "MYVAL"
int main(int argc,char* argv[],char* env[]){
    for(int i = 0;i<argc;i++){
        printf("argc[%d]=%s\n",i,argv[i]);
    }

    printf("\n\n\n");
    for(int i = 0;env[i];i++){
        printf("env[%d]=%s\n",i,env[i]);
    }

    printf("\n\n\n");
    extern char** environ;
    for(int i = 0;environ[i];i++){
        printf("environ[%d]=%s\n",i,environ[i]);
    }
    //char* myenv = getenv(MYVAL);
    //if(NULL == myenv){
    //    printf("%s,Not Found!\n",MYVAL);
    //}
    //else{
    //    printf("%s=%s\n",myenv,MYVAL);
    //}
    //char *who = getenv(USER);
    //if(strcmp(who,"root")==0){
    //    printf("user:%s\n",who);
    //}
    //else{
    //    printf("权限不足\n");
    //}
    return 0;
}
